<!DOCTYPE html>
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
  <meta name="description" content="tong.li&#39;s blog">
  <meta name="keyword" content="彤哥哥博客，95后技术爱好者,现就职于同程旅行/同程艺龙上海分公司，专注于互联网技术分享的平台。">
  
    <link rel="shortcut icon" href="/css/images/icon.png">
  
  <title>
    
      【Linux】CentOS 7.9安装无线驱动.md | 彤哥哥的博客
    
  </title>
  <link href="https://cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
  <link href="https://cdn.staticfile.org/nprogress/0.2.0/nprogress.min.css" rel="stylesheet">
  <link href="https://cdn.staticfile.org/highlight.js/9.12.0/styles/tomorrow-night.min.css" rel="stylesheet">
  
<link rel="stylesheet" href="/css/style.css">

  
  <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
  <script src="https://cdn.staticfile.org/geopattern/1.2.3/js/geopattern.min.js"></script>
  <script src="https://cdn.staticfile.org/nprogress/0.2.0/nprogress.min.js"></script>
  
    
<script src="/js/qrious.js"></script>

  
  
  
  
    <!-- MathJax support START -->
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
        }
      });
    </script>

    <script type="text/x-mathjax-config">
      MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for (i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
        }
      });
    </script>
    <script type="text/javascript" src="https://cdn.staticfile.org/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <!-- MathJax support END -->
  


  
  
    
<script src="/js/local-search.js"></script>


<meta name="generator" content="Hexo 5.4.2"></head>
<div class="wechat-share">
  <img src="/css/images/logo.png" />
</div>
  <body>
    <header class="header fixed-header">
  <div class="header-container">
    <a class="home-link" href="/">
      <div class="logo"></div>
      <span>彤哥哥的博客</span>
    </a>
    <ul class="right-list">
      
        <li class="list-item">
          
            <a href="/" class="item-link">主页</a>
          
        </li>
      
        <li class="list-item">
          
            <a href="/series/" class="item-link">分类</a>
          
        </li>
      
        <li class="list-item">
          
            <a href="/tags/" class="item-link">标签</a>
          
        </li>
      
        <li class="list-item">
          
            <a href="/archives/" class="item-link">归档</a>
          
        </li>
      
        <li class="list-item">
          
            <a href="/project/" class="item-link">项目</a>
          
        </li>
      
        <li class="list-item">
          
            <a href="/about/" class="item-link">关于</a>
          
        </li>
      
      
        <li class="menu-item menu-item-search right-list">
    <a role="button" class="popup-trigger">
        <i class="fa fa-search fa-fw"></i>
    </a>
</li>
      
    </ul>
    <div class="menu">
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </div>
    <div class="menu-mask">
      <ul class="menu-list">
        
          <li class="menu-item">
            
              <a href="/" class="menu-link">主页</a>
            
          </li>
        
          <li class="menu-item">
            
              <a href="/series/" class="menu-link">分类</a>
            
          </li>
        
          <li class="menu-item">
            
              <a href="/tags/" class="menu-link">标签</a>
            
          </li>
        
          <li class="menu-item">
            
              <a href="/archives/" class="menu-link">归档</a>
            
          </li>
        
          <li class="menu-item">
            
              <a href="/project/" class="menu-link">项目</a>
            
          </li>
        
          <li class="menu-item">
            
              <a href="/about/" class="menu-link">关于</a>
            
          </li>
        
      </ul>
    </div>
    
      <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
            <span class="search-icon">
                <i class="fa fa-search"></i>
            </span>
            <div class="search-input-container">
                <input autocomplete="off" autocapitalize="off"
                    placeholder="Please enter your keyword(s) to search." spellcheck="false"
                    type="search" class="search-input">
            </div>
            <span class="popup-btn-close">
                <i class="fa fa-times-circle"></i>
            </span>
        </div>
        <div id="search-result">
            <div id="no-result">
                <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
            </div>
        </div>
    </div>
</div>
    
  </div>
</header>

    <div id="article-banner">
  <h2>【Linux】CentOS 7.9安装无线驱动.md</h2>
  <p class="post-date">2024-01-26</p>
  <div class="arrow-down">
    <a href="javascript:;"></a>
  </div>
</div>
<main class="app-body flex-box">
  <!-- Article START -->
  <article class="post-article">
    <section class="markdown-content"><h1 id="1-前言"><a href="#1-前言" class="headerlink" title="1. 前言"></a>1. 前言</h1><p>闲来无事，给自己废弃的笔记本（<a target="_blank" rel="noopener" href="https://detail.zol.com.cn/notebook/index380729.shtml">Lenovo Y430p</a>）裸机装了Linux，Linux发行版为CentOS 7.9 minimal版，以下为笔记本的配置信息：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line">[root@localhost ~]<span class="comment"># lscpu  # CPU信息</span></span><br><span class="line">Architecture:          x86_64</span><br><span class="line">CPU op-mode(s):        32-bit, 64-bit</span><br><span class="line">Byte Order:            Little Endian</span><br><span class="line">CPU(s):                4</span><br><span class="line">On-line CPU(s) list:   0-3</span><br><span class="line">Thread(s) per core:    2</span><br><span class="line">Core(s) per socket:    2</span><br><span class="line">座：                 1</span><br><span class="line">NUMA 节点：         1</span><br><span class="line">厂商 ID：           GenuineIntel</span><br><span class="line">CPU 系列：          6</span><br><span class="line">型号：              60</span><br><span class="line">型号名称：        Intel(R) Core(TM) i5-4210M CPU @ 2.60GHz</span><br><span class="line">步进：              3</span><br><span class="line">CPU MHz：             730.139</span><br><span class="line">CPU max MHz:           3200.0000</span><br><span class="line">CPU min MHz:           800.0000</span><br><span class="line">BogoMIPS：            5188.23</span><br><span class="line">虚拟化：           VT-x</span><br><span class="line">L1d 缓存：          32K</span><br><span class="line">L1i 缓存：          32K</span><br><span class="line">L2 缓存：           256K</span><br><span class="line">L3 缓存：           3072K</span><br><span class="line">NUMA 节点0 CPU：    0-3</span><br><span class="line">Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb invpcid_single ssbd rsb_ctxsw ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear spec_ctrl intel_stibp flush_l1d</span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">[root@localhost ~]<span class="comment"># free -m  # 查看内存信息</span></span><br><span class="line">              total        used        free      shared  buff/cache   available</span><br><span class="line">Mem:          11765         287       10744           9         733       11216</span><br><span class="line">Swap:          6015           0        6015</span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br></pre></td><td class="code"><pre><span class="line">[root@localhost ~]<span class="comment"># lsblk  # 查看磁盘信息</span></span><br><span class="line">NAME            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT</span><br><span class="line">sda               8:0    0 931.5G  0 disk </span><br><span class="line">├─sda1            8:1    0   200M  0 part /boot/efi</span><br><span class="line">├─sda2            8:2    0     1G  0 part /boot</span><br><span class="line">└─sda3            8:3    0 930.3G  0 part </span><br><span class="line">  ├─centos-root 253:0    0    50G  0 lvm  /</span><br><span class="line">  ├─centos-swap 253:1    0   5.9G  0 lvm  [SWAP]</span><br><span class="line">  └─centos-home 253:2    0 874.4G  0 lvm  /home</span><br><span class="line">sr0              11:0    1  1024M  0 rom </span><br><span class="line">[root@localhost ~]<span class="comment"># fdisk -l</span></span><br><span class="line">WARNING: fdisk GPT support is currently new, and therefore <span class="keyword">in</span> an experimental phase. Use at your own discretion.</span><br><span class="line"></span><br><span class="line">磁盘 /dev/sda：1000.2 GB, 1000204886016 字节，1953525168 个扇区</span><br><span class="line">Units = 扇区 of 1 * 512 = 512 bytes</span><br><span class="line">扇区大小(逻辑/物理)：512 字节 / 4096 字节</span><br><span class="line">I/O 大小(最小/最佳)：4096 字节 / 4096 字节</span><br><span class="line">磁盘标签类型：gpt</span><br><span class="line">Disk identifier: 72112701-886A-43F6-9FF3-33BFBD4E05E4</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">#         Start          End    Size  Type            Name</span></span><br><span class="line"> 1         2048       411647    200M  EFI System      EFI System Partition</span><br><span class="line"> 2       411648      2508799      1G  Microsoft basic </span><br><span class="line"> 3      2508800   1953523711  930.3G  Linux LVM       </span><br><span class="line"></span><br><span class="line">磁盘 /dev/mapper/centos-root：53.7 GB, 53687091200 字节，104857600 个扇区</span><br><span class="line">Units = 扇区 of 1 * 512 = 512 bytes</span><br><span class="line">扇区大小(逻辑/物理)：512 字节 / 4096 字节</span><br><span class="line">I/O 大小(最小/最佳)：4096 字节 / 4096 字节</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">磁盘 /dev/mapper/centos-swap：6308 MB, 6308233216 字节，12320768 个扇区</span><br><span class="line">Units = 扇区 of 1 * 512 = 512 bytes</span><br><span class="line">扇区大小(逻辑/物理)：512 字节 / 4096 字节</span><br><span class="line">I/O 大小(最小/最佳)：4096 字节 / 4096 字节</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">磁盘 /dev/mapper/centos-home：938.9 GB, 938915921920 字节，1833820160 个扇区</span><br><span class="line">Units = 扇区 of 1 * 512 = 512 bytes</span><br><span class="line">扇区大小(逻辑/物理)：512 字节 / 4096 字节</span><br><span class="line">I/O 大小(最小/最佳)：4096 字节 / 4096 字节</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">[root@localhost ~]<span class="comment"># uname -a  # 查看系统信息</span></span><br><span class="line">Linux localhost.localdomain 3.10.0-1160.105.1.el7.x86_64 <span class="comment">#1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux</span></span><br><span class="line">[root@localhost ~]<span class="comment"># cat /etc/redhat-release # 查看系统版本</span></span><br><span class="line">CentOS Linux release 7.9.2009 (Core)</span><br></pre></td></tr></table></figure>

<p>装好系统后，查看网络信息时，只有本地回环网和有线网络，并没有识别到无线网卡。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">[root@localhost ~]<span class="comment"># ip addr</span></span><br><span class="line">1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000</span><br><span class="line">    <span class="built_in">link</span>/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00</span><br><span class="line">    inet 127.0.0.1/8 scope host lo</span><br><span class="line">       valid_lft forever preferred_lft forever</span><br><span class="line">    inet6 ::1/128 scope host </span><br><span class="line">       valid_lft forever preferred_lft forever</span><br><span class="line">2: enp7s0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc mq state UP group default qlen 1000</span><br><span class="line">    <span class="built_in">link</span>/ether 28:d2:44:e2:99:f3 brd ff:ff:ff:ff:ff:ff</span><br><span class="line">    inet 192.168.0.103/24 brd 192.168.0.255 scope global noprefixroute dynamic enp7s0</span><br><span class="line">       valid_lft 7177sec preferred_lft 7177sec</span><br><span class="line">    inet6 fe80::f5d0:b1a9:ff55:c82c/64 scope <span class="built_in">link</span> noprefixroute </span><br><span class="line">       valid_lft forever preferred_lft forever</span><br></pre></td></tr></table></figure>

<p>这就很尴尬，于是开启的无线网卡驱动的寻找之路。</p>
<p>最开始想着从<a target="_blank" rel="noopener" href="https://newsupport.lenovo.com.cn/driveList.html?fromsource=driveList&selname=Lenovo%20Y430p">联想官网</a>获得驱动信息，发现只有Windows版本，当时是真的生无可恋了。</p>
<p>通过Google与ChatGPT的了解，发现也没有可以直接用的无线驱动包，那么也只能自己去构造适配当前系统的无线驱动包。</p>
<h1 id="2-构造无线驱动包"><a href="#2-构造无线驱动包" class="headerlink" title="2. 构造无线驱动包"></a>2. 构造无线驱动包</h1><p>首先，先接入有线网络，确保网络畅通，在这里别问为什么，容易挨打。</p>
<p>再看看自己的硬件信息，找出无线网卡信息，我这里是Broadcom BCM43142。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">[root@localhost ~]<span class="comment"># lspci </span></span><br><span class="line">‘00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor DRAM Controller (rev 06)</span><br><span class="line">00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller (rev 06)</span><br><span class="line">00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)</span><br><span class="line">00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)</span><br><span class="line">00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 05)</span><br><span class="line">00:16.0 Communication controller: Intel Corporation 8 Series/C220 Series Chipset Family MEI Controller <span class="comment">#1 (rev 04)</span></span><br><span class="line">00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI <span class="comment">#2 (rev 05)</span></span><br><span class="line">00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 05)</span><br><span class="line">00:1c.0 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port <span class="comment">#4 (rev d5)</span></span><br><span class="line">00:1c.4 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port <span class="comment">#5 (rev d5)</span></span><br><span class="line">00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI <span class="comment">#1 (rev 05)</span></span><br><span class="line">00:1f.0 ISA bridge: Intel Corporation HM86 Express LPC Controller (rev 05)</span><br><span class="line">00:1f.2 SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] (rev 05)</span><br><span class="line">00:1f.3 SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller (rev 05)</span><br><span class="line">01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 850M] (rev a2)</span><br><span class="line">07:00.0 Ethernet controller: Qualcomm Atheros QCA8171 Gigabit Ethernet (rev 10)</span><br><span class="line">08:00.0 Network controller: Broadcom Inc. and subsidiaries BCM43142 802.11b/g/n (rev 01)	</span><br></pre></td></tr></table></figure>

<blockquote>
<p>[!CAUTION]</p>
<p><strong>请注意下述命令不要用root操作，非常重要！！！</strong></p>
</blockquote>
<p>接着，下载两个用于构建驱动包的文件，如下</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">[clare@localhost ~]$  sudo yum -y install wget</span><br><span class="line">[clare@localhost ~]$  wget https://docs.broadcom.com/docs-and-downloads/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz  <span class="comment"># 这个可以从博通官网去搜索，注意我这里下载的是是64位系统文件</span></span><br><span class="line">[clare@localhost ~]$  wget https://linux.cc.iitk.ac.in/mirror/centos/elrepo/elrepo/el7/SRPMS/wl-kmod-6_30_223_271-5.el7.elrepo.nosrc.rpm  <span class="comment"># 这个也可以从第三方的网站找到，已标注在文末相关文档里，注意版本号与上述文件保持一致</span></span><br></pre></td></tr></table></figure>

<blockquote>
<p>[!CAUTION]</p>
<p><strong>请注意下载的两个文件版本必须保持一致，非常重要！！！</strong></p>
</blockquote>
<p>然后，在系统上安装构建驱动包的必备依赖。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">[clare@localhost ~]$ sudo yum install rpm-build</span><br><span class="line">[clare@localhost ~]$ sudo yum group install -y <span class="string">&#x27;Development Tools&#x27;</span></span><br><span class="line">[clare@localhost ~]$ sudo yum install redhat-lsb kernel-abi-whitelists -y </span><br><span class="line">[clare@localhost ~]$ sudo yum install kernel-devel-$(<span class="built_in">uname</span> -r)</span><br></pre></td></tr></table></figure>

<p>然后，建立rpmbuild环境。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">[clare@localhost ~]$ <span class="built_in">mkdir</span> -p ~/rpmbuild/&#123;BUILD,RPMS,SPECS,SOURCES,SRPMS&#125;</span><br><span class="line">[clare@localhost ~]$ <span class="built_in">echo</span> -e <span class="string">&quot;%_topdir <span class="subst">$(echo $HOME)</span>/rpmbuild\n%dist .el<span class="subst">$(lsb_release -s -r|cut -d<span class="string">&quot;.&quot;</span> -f1)</span>.local&quot;</span> &gt;&gt; ~/.rpmmacros</span><br></pre></td></tr></table></figure>

<p>然后，将下载好后的文件复制到指定的目录中。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">[clare@localhost ~]$ <span class="built_in">cp</span> ./hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz ~/rpmbuild/SOURCES/</span><br><span class="line">[clare@localhost ~]$ <span class="built_in">cp</span> ./wl-kmod-6_30_223_271-5.el7.elrepo.nosrc.rpm ~/rpmbuild/SRPMS/</span><br></pre></td></tr></table></figure>

<p>接下来，开始最重要的部分-rpmbuild驱动</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[clare@localhost ~]$ rpmbuild --rebuild --define <span class="string">&#x27;packager default&#x27;</span> ~/rpmbuild/SRPMS/wl-kmod-6_30_223_271-5.el7.elrepo.nosrc.rpm </span><br></pre></td></tr></table></figure>

<p>构建完成后，我们会发现在~/rpmbuild/RPMS/x86_64/目录下有个无线驱动包。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">[clare@localhost ~]$ ll ./rpmbuild/RPMS/x86_64/</span><br><span class="line">总用量 1560</span><br><span class="line">-rw-rw-r--. 1 clare clare 1597404 1月  26 21:36 kmod-wl-6_30_223_271-5.el7.local.x86_64.rpm</span><br></pre></td></tr></table></figure>

<p>安装无线驱动包。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">[root@localhost clare]<span class="comment"># rpm -Uvh /home/clare/rpmbuild/RPMS/x86_64/kmod-wl-6_30_223_271-5.el7.local.x86_64.rpm </span></span><br><span class="line">准备中...                          <span class="comment">################################# [100%]</span></span><br><span class="line">正在升级/安装...</span><br><span class="line">   1:kmod-wl-6_30_223_271-5.el7.local <span class="comment">################################# [100%]</span></span><br><span class="line">Working. This may take some time ...</span><br><span class="line">Done.</span><br></pre></td></tr></table></figure>

<p>加载驱动到内核中，并重启。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">[root@localhost clare]<span class="comment"># modprobe wl</span></span><br><span class="line">[root@localhost clare]<span class="comment"># reboot</span></span><br></pre></td></tr></table></figure>

<p>重启后，发现网络多个无线网卡信息。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line">[root@localhost ~]<span class="comment"># ip addr</span></span><br><span class="line">1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000</span><br><span class="line">    <span class="built_in">link</span>/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00</span><br><span class="line">    inet 127.0.0.1/8 scope host lo</span><br><span class="line">       valid_lft forever preferred_lft forever</span><br><span class="line">    inet6 ::1/128 scope host </span><br><span class="line">       valid_lft forever preferred_lft forever</span><br><span class="line">2: enp7s0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc mq state UP group default qlen 1000</span><br><span class="line">    <span class="built_in">link</span>/ether 28:d2:44:e2:99:f3 brd ff:ff:ff:ff:ff:ff</span><br><span class="line">    inet 192.168.0.103/24 brd 192.168.0.255 scope global noprefixroute dynamic enp7s0</span><br><span class="line">       valid_lft 7177sec preferred_lft 7177sec</span><br><span class="line">    inet6 fe80::f5d0:b1a9:ff55:c82c/64 scope <span class="built_in">link</span> noprefixroute </span><br><span class="line">       valid_lft forever preferred_lft forever</span><br><span class="line">3: wlp8s0: &lt;NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast state DORMANT group default qlen 1000</span><br><span class="line">    <span class="built_in">link</span>/ether 8e:ce:95:a1:f3:99 brd ff:ff:ff:ff:ff:ff</span><br></pre></td></tr></table></figure>

<blockquote>
<p>[!TIP]</p>
<p><strong>记得将两个下载的源文件与构建好的驱动文件备份，以防后续重新构建。</strong></p>
</blockquote>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">alex@alexdeMacBook-Pro ~ % scp root@192.168.241.241:/home/clare/rpmbuild/SOURCES/hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz ./</span><br><span class="line">alex@alexdeMacBook-Pro ~ % scp root@192.168.241.241:/home/clare/rpmbuild/SRPMS/wl-kmod-6_30_223_271-5.el7.elrepo.nosrc.rpm ./</span><br><span class="line">alex@alexdeMacBook-Pro ~ % scp root@192.168.241.241:/home/clare/rpmbuild/RPMS/x86_64/kmod-wl-6_30_223_271-5.el7.local.x86_64.rpm</span><br><span class="line">alex@alexdeMacBook-Pro ~ % <span class="built_in">ls</span> -lh  <span class="comment"># 最后三个文件请备份，以防后续使用</span></span><br><span class="line">total 10480</span><br><span class="line">drwx------+  5 alex  staff   160B  1 29 14:30 Desktop</span><br><span class="line">drwx------+  4 alex  staff   128B  1  2 14:03 Documents</span><br><span class="line">drwx------@ 12 alex  staff   384B  1 29 15:14 Downloads</span><br><span class="line">drwx------@ 85 alex  staff   2.7K 12 25 14:06 Library</span><br><span class="line">drwx------   3 alex  staff    96B 12 21 15:30 Movies</span><br><span class="line">drwx------+  4 alex  staff   128B 12 21 20:48 Music</span><br><span class="line">drwx------+  4 alex  staff   128B 12 21 19:48 Pictures</span><br><span class="line">drwxr-xr-x+  4 alex  staff   128B 12 21 15:30 Public</span><br><span class="line">drwxr-xr-x  91 alex  staff   2.8K  1 29 19:11 blog-posts</span><br><span class="line">-rw-r--r--   1 alex  staff   2.8M  1 29 19:05 hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz</span><br><span class="line">-rw-r--r--   1 alex  staff   1.5M  1 29 19:07 kmod-wl-6_30_223_271-5.el7.local.x86_64.rpm</span><br><span class="line">-rw-r--r--   1 alex  staff    20K  1 29 19:08 wl-kmod-6_30_223_271-5.el7.elrepo.nosrc.rpm</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<h1 id="3-连接无线网络"><a href="#3-连接无线网络" class="headerlink" title="3. 连接无线网络"></a>3. 连接无线网络</h1><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">[root@localhost ~]<span class="comment"># yum install iw # 安装iw无线网络工具包</span></span><br><span class="line">[root@localhost ~]<span class="comment"># yum install NetworkManager # 非必需，CentOS 7.9一般是自带的</span></span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">[root@localhost ~]<span class="comment"># iw dev #查看无线网络接口</span></span><br><span class="line">phy<span class="comment">#0</span></span><br><span class="line">	Interface wlp8s0   <span class="comment"># 无线网卡名称</span></span><br><span class="line">		ifindex 3</span><br><span class="line">		wdev 0x1</span><br><span class="line">		addr 8e:ce:95:a1:f3:99</span><br><span class="line">		<span class="built_in">type</span> managed</span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">[root@localhost ~]<span class="comment"># iw dev wlp8s0 scan | grep SSID   # 扫描附近的无线网络</span></span><br><span class="line">	SSID: TP-LINK_ED8D</span><br><span class="line">	SSID: </span><br><span class="line">	SSID: suma_ap</span><br><span class="line">	SSID: TP-LINK_8CBE</span><br><span class="line">	SSID: ChinaNet-ganm</span><br><span class="line">	Extended capabilities: BSS Transition, SSID List</span><br><span class="line">	Extended capabilities: BSS Transition, SSID List, 6, 6</span><br><span class="line">	SSID: ChinaNet-sxCa</span><br><span class="line">	SSID: @PHICOMM_30</span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">[root@localhost ~]<span class="comment"># nmcli dev wifi connect TP-LINK_ED8D password 你的wifi密码  # 连接指定的无线网络</span></span><br><span class="line">成功用 <span class="string">&quot;wlp8s0305514d2-47a0-41b5-8d00-295eb931fadc&quot;</span> 激活了设备 <span class="string">&quot;&quot;</span>。</span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line">[root@localhost ~]<span class="comment"># ip addr  # 查看连接成功后的无线网络</span></span><br><span class="line">1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000</span><br><span class="line">    <span class="built_in">link</span>/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00</span><br><span class="line">    inet 127.0.0.1/8 scope host lo</span><br><span class="line">       valid_lft forever preferred_lft forever</span><br><span class="line">    inet6 ::1/128 scope host </span><br><span class="line">       valid_lft forever preferred_lft forever</span><br><span class="line">2: enp7s0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc mq state UP group default qlen 1000</span><br><span class="line">    <span class="built_in">link</span>/ether 28:d2:44:e2:99:f3 brd ff:ff:ff:ff:ff:ff</span><br><span class="line">    inet 192.168.0.103/24 brd 192.168.0.255 scope global noprefixroute dynamic enp7s0</span><br><span class="line">       valid_lft 6765sec preferred_lft 6765sec</span><br><span class="line">    inet6 fe80::f5d0:b1a9:ff55:c82c/64 scope <span class="built_in">link</span> noprefixroute </span><br><span class="line">       valid_lft forever preferred_lft forever</span><br><span class="line">3: wlp8s0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast state UP group default qlen 1000</span><br><span class="line">    <span class="built_in">link</span>/ether 14:2d:27:fb:d9:b5 brd ff:ff:ff:ff:ff:ff</span><br><span class="line">    inet 192.168.0.107/24 brd 192.168.0.255 scope global noprefixroute dynamic wlp8s0</span><br><span class="line">       valid_lft 7183sec preferred_lft 7183sec</span><br><span class="line">    inet6 fe80::320f:371:ca45:d48e/64 scope <span class="built_in">link</span> noprefixroute </span><br><span class="line">       valid_lft forever preferred_lft forever</span><br></pre></td></tr></table></figure>

<p>笔记本盒盖后，网络自动断开，系统被挂起，那么进行如下解决：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">[root@localhost ~]<span class="comment"># vim /etc/systemd/logind.conf  # 将HandleLidSwitch设置为锁屏即可</span></span><br><span class="line"></span><br><span class="line">[Login]</span><br><span class="line"><span class="comment">#NAutoVTs=6</span></span><br><span class="line"><span class="comment">#ReserveVT=6</span></span><br><span class="line"><span class="comment">#KillUserProcesses=no</span></span><br><span class="line"><span class="comment">#KillOnlyUsers=</span></span><br><span class="line"><span class="comment">#KillExcludeUsers=root</span></span><br><span class="line"><span class="comment">#InhibitDelayMaxSec=5</span></span><br><span class="line"><span class="comment">#HandlePowerKey=poweroff</span></span><br><span class="line"><span class="comment">#HandleSuspendKey=suspend</span></span><br><span class="line"><span class="comment">#HandleHibernateKey=hibernate</span></span><br><span class="line"><span class="comment">#HandleLidSwitch=suspend</span></span><br><span class="line">HandleLidSwitch=lock</span><br><span class="line"><span class="string">&quot;/etc/systemd/logind</span></span><br><span class="line"><span class="string">[root@localhost ~]# systemctl restart systemd-logind  # 重启服务即可</span></span><br></pre></td></tr></table></figure>

<blockquote>
<p><strong>配置项说明</strong></p>
<ul>
<li>HandlePowerKey 按下电源键后的行为，默认power off。</li>
<li>HandleSleepKey 按下挂起键后的行为，默认suspend。</li>
<li>HandleHibernateKey 按下休眠键后的行为，默认hibernate。</li>
<li>HandleLidSwitch 合上笔记本盖后的行为，默认suspend。</li>
</ul>
<p>配置项范围</p>
<ul>
<li><code>ignore</code> 忽略，跳过</li>
<li><code>power off</code> 关机</li>
<li><code>eboot</code> 重启</li>
<li><code>halt</code> 挂起</li>
<li><code>suspend</code> shell内建指令，可暂停目前正在执行的shell。若要恢复，则必须使用SIGCONT信息。所有的进程都会暂停，但不是消失（halt是进程关闭）</li>
<li><code>hibernate</code> 让笔记本进入休眠状态</li>
<li><code>hybrid-sleep</code> 混合睡眠，主要是为台式机设计的，是睡眠和休眠的结合体，当你选择Hybird时，系统会像休眠一样把内存里的数据从头到尾复制到硬盘里 ，然后进入睡眠状态，即内存和CPU还是活动的，其他设置不活动，这样你想用电脑时就可以快速恢复到之前的状态了，笔记本一般不用这个功能。</li>
<li><code>lock</code> 仅锁屏，计算机继续工作。</li>
</ul>
</blockquote>
<h1 id="4-过程问题及解决"><a href="#4-过程问题及解决" class="headerlink" title="4. 过程问题及解决"></a>4. 过程问题及解决</h1><p>当然在上述过程中出现很多问题，尤其是rpmbuild阶段需要关注。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">[clare@localhost ~]$ rpmbuild --rebuild --target=`<span class="built_in">uname</span> -m` ~/rpmbuild/SRPMS/wl-kmod-6_30_223_271-5.el7.elrepo.nosrc.rpm</span><br><span class="line">正在安装 /home/clare/rpmbuild/SRPMS/wl-kmod-6_30_223_271-5.el7.elrepo.nosrc.rpm</span><br><span class="line">警告：/home/clare/rpmbuild/SRPMS/wl-kmod-6_30_223_271-5.el7.elrepo.nosrc.rpm: 头V4 DSA/SHA1 Signature, 密钥 ID baadae52: NOKEY</span><br><span class="line">构建目标平台：x86_64</span><br><span class="line">为目标x86_64构建</span><br><span class="line">错误：构建依赖失败：</span><br><span class="line">	kernel-abi-whitelists 被 wl-kmod-6_30_223_271-5.el7.local.x86_64 需要</span><br><span class="line"><span class="comment"># 通过root账户更新yum依赖解决</span></span><br><span class="line">[root@localhost clare]<span class="comment"># yum update</span></span><br><span class="line">[root@localhost clare]<span class="comment"># yum install kernel-abi-whitelists</span></span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">警告：用户tindall 不存在 - 使用root</span><br><span class="line">警告：群组tindall 不存在 - 使用root</span><br><span class="line">警告：用户tindall 不存在 - 使用root</span><br><span class="line">警告：群组tindall 不存在 - 使用root</span><br><span class="line">警告：用户tindall 不存在 - 使用root</span><br><span class="line">警告：群组tindall 不存在 - 使用root</span><br><span class="line"><span class="comment"># 通过切换到root账户创建tindall用户和tindall用户组解决</span></span><br><span class="line">[root@localhost clare]<span class="comment"># useradd -m tindall</span></span><br><span class="line">[root@localhost clare]<span class="comment"># passwd tindall</span></span><br><span class="line">[root@localhost clare]<span class="comment"># groupadd tindall</span></span><br><span class="line">[root@localhost clare]<span class="comment"># usermod -aG tindall tindall</span></span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">/wl-kmod-6_30_223_271-5.el7.elrepo.nosrc.rpm: 头V4 DSA/SHA1 Signature, 密钥 ID baadae52: NOKEY</span><br><span class="line">/var/tmp/rpm-tmp.ajf4xk (%build) 退出状态不好</span><br><span class="line"><span class="comment"># 通过执行sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7解决</span></span><br><span class="line"><span class="comment"># 或者执行这个也可以，rpmbuild --rebuild --target=`uname -m` --nosignature ~/rpmbuild/SRPMS/wl-kmod-6_30_223_271-5.el7.elrepo.nosrc.rpm</span></span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">警告：RPM 数据库已被非 yum 程序修改怎么解决</span><br><span class="line"><span class="comment"># 1. 先尝试修复RPM数据库，不行的话试一试下面2的操作</span></span><br><span class="line">[root@localhost clare] rpm --rebuilddb</span><br><span class="line"></span><br><span class="line"><span class="comment"># 2. 尝试清理RPM缓存并重新安装yum，不行的话试一试下面3的操作</span></span><br><span class="line">[root@localhost clare] <span class="built_in">rm</span> -r /var/cache/yum</span><br><span class="line">[root@localhost clare] yum clean all</span><br><span class="line">[root@localhost clare] yum update</span><br><span class="line"></span><br><span class="line"><span class="comment"># 3. 手动修复RPM数据库</span></span><br><span class="line">[root@localhost clare] <span class="built_in">mv</span> /var/lib/rpm/__db* /tmp/</span><br><span class="line">[root@localhost clare] rpm --rebuilddb</span><br><span class="line">[root@localhost clare] yum update</span><br></pre></td></tr></table></figure>


<h1 id="5-参考文档"><a href="#5-参考文档" class="headerlink" title="5. 参考文档"></a>5. 参考文档</h1><ul>
<li><a target="_blank" rel="noopener" href="https://www.broadcom.com/site-search?filters%5Bpages%5D%5Bcontent_type%5D%5Btype%5D=and&filters%5Bpages%5D%5Bcontent_type%5D%5Bvalues%5D%5B%5D=Downloads&page=1&per_page=10&q=BCM4313">博通官网驱动搜索页</a></li>
<li><a target="_blank" rel="noopener" href="https://linux.cc.iitk.ac.in/mirror/centos/elrepo/elrepo/el7/SRPMS/">elrepo文件搜索页</a></li>
<li><a target="_blank" rel="noopener" href="https://zhuanlan.zhihu.com/p/435631217">linux安装BCM43142无线网卡驱动</a></li>
<li><a target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_30649185/article/details/116678631">联想Y430p无线驱动网卡安装</a></li>
<li><a target="_blank" rel="noopener" href="https://www.cnblogs.com/mrway/p/9416246.html">Centos7安装bcm43142无线网卡驱动-采用rpmbuild方法</a></li>
<li><a target="_blank" rel="noopener" href="https://www.coonote.com/linux-note/lsb_release-a.html">未找到-bash: lsb_release解决方式</a></li>
<li><a target="_blank" rel="noopener" href="http://www.taodudu.cc/news/show-4529268.html?action=onClick">笔记本盒盖网络断开处理</a></li>
</ul>
</section>
    <!-- Tags START -->
    
      <div class="tags">
        <span>Tags:</span>
        
  <a href="/tags#Linux" >
    <span class="tag-code">Linux</span>
  </a>

      </div>
    
    <!-- Tags END -->
    <!-- NAV START -->
    
  <div class="nav-container">
    <!-- reverse left and right to put prev and next in a more logic postition -->
    
      <a class="nav-left" href="/2023/02/01/%E3%80%90%E7%94%9F%E6%B4%BB%E3%80%91%E4%BA%8C%E6%89%8B%E6%88%BF%E8%B4%AD%E4%B9%B0%E6%8C%87%E5%8D%97/">
        <span class="nav-arrow">← </span>
        
          【生活】二手房购买指南
        
      </a>
    
    
  </div>

    <!-- NAV END -->
    <!-- 打赏 START -->
    
      <div class="money-like">
        <div class="reward-btn">
          赏
          <span class="money-code">
            <span class="alipay-code">
              <div class="code-image"></div>
              <b>使用支付宝打赏</b>
            </span>
            <span class="wechat-code">
              <div class="code-image"></div>
              <b>使用微信打赏</b>
            </span>
          </span>
        </div>
        <p class="notice">若你觉得我的文章对你有帮助，欢迎点击上方按钮对我打赏</p>
      </div>
    
    <!-- 打赏 END -->
    <!-- 二维码 START -->
    
      <div class="qrcode">
        <canvas id="share-qrcode"></canvas>
        <p class="notice">扫描二维码，分享此文章</p>
      </div>
    
    <!-- 二维码 END -->
    
      <!-- Utterances START -->
      <div id="utterances"></div>
      <script src="https://utteranc.es/client.js"
        repo="ltyeamin/blogtalks"
        issue-term="pathname"
        theme="github-light"
        crossorigin="anonymous"
        async></script>    
      <!-- Utterances END -->
    
  </article>
  <!-- Article END -->
  <!-- Catalog START -->
  
    <aside class="catalog-container">
  <div class="toc-main">
    <strong class="toc-title">Catalog</strong>
    
      <ol class="toc-nav"><li class="toc-nav-item toc-nav-level-1"><a class="toc-nav-link" href="#1-%E5%89%8D%E8%A8%80"><span class="toc-nav-text">1. 前言</span></a></li><li class="toc-nav-item toc-nav-level-1"><a class="toc-nav-link" href="#2-%E6%9E%84%E9%80%A0%E6%97%A0%E7%BA%BF%E9%A9%B1%E5%8A%A8%E5%8C%85"><span class="toc-nav-text">2. 构造无线驱动包</span></a></li><li class="toc-nav-item toc-nav-level-1"><a class="toc-nav-link" href="#3-%E8%BF%9E%E6%8E%A5%E6%97%A0%E7%BA%BF%E7%BD%91%E7%BB%9C"><span class="toc-nav-text">3. 连接无线网络</span></a></li><li class="toc-nav-item toc-nav-level-1"><a class="toc-nav-link" href="#4-%E8%BF%87%E7%A8%8B%E9%97%AE%E9%A2%98%E5%8F%8A%E8%A7%A3%E5%86%B3"><span class="toc-nav-text">4. 过程问题及解决</span></a></li><li class="toc-nav-item toc-nav-level-1"><a class="toc-nav-link" href="#5-%E5%8F%82%E8%80%83%E6%96%87%E6%A1%A3"><span class="toc-nav-text">5. 参考文档</span></a></li></ol>
    
  </div>
</aside>
  
  <!-- Catalog END -->
</main>

<script>
  (function () {
    var url = 'http://example.com/2024/01/26/【Linux】CentOS 7.9安装无线驱动/';
    var banner = ''
    if (banner !== '' && banner !== 'undefined' && banner !== 'null') {
      $('#article-banner').css({
        'background-image': 'url(' + banner + ')'
      })
    } else {
      $('#article-banner').geopattern(url)
    }
    $('.header').removeClass('fixed-header')

    // error image
    $(".markdown-content img").on('error', function() {
      $(this).attr('src', '/css/images/error_icon.png')
      $(this).css({
        'cursor': 'default'
      })
    })

    // zoom image
    $(".markdown-content img").on('click', function() {
      var src = $(this).attr('src')
      if (src !== '/css/images/error_icon.png') {
        var imageW = $(this).width()
        var imageH = $(this).height()

        var zoom = ($(window).width() * 0.95 / imageW).toFixed(2)
        zoom = zoom < 1 ? 1 : zoom
        zoom = zoom > 2 ? 2 : zoom
        var transY = (($(window).height() - imageH) / 2).toFixed(2)

        $('body').append('<div class="image-view-wrap"><div class="image-view-inner"><img src="'+ src +'" /></div></div>')
        $('.image-view-wrap').addClass('wrap-active')
        $('.image-view-wrap img').css({
          'width': `${imageW}`,
          'transform': `translate3d(0, ${transY}px, 0) scale3d(${zoom}, ${zoom}, 1)`
        })
        $('html').css('overflow', 'hidden')

        $('.image-view-wrap').on('click', function() {
          $(this).remove()
          $('html').attr('style', '')
        })
      }
    })
  })();
</script>


  <script>
    var qr = new QRious({
      element: document.getElementById('share-qrcode'),
      value: document.location.href
    });
  </script>






    <div class="scroll-top">
  <span class="arrow-icon"></span>
</div>
    <footer class="app-footer">
  <p class="copyright">
    &copy; 2024 | Proudly powered by <a href="https://hexo.io" target="_blank">Hexo</a>
    <br>
    Theme by <a target="_blank" rel="noopener" href="https://github.com/ltyeamin">tong.li</a>
  </p>
</footer>

<script>
  function async(u, c) {
    var d = document, t = 'script',
      o = d.createElement(t),
      s = d.getElementsByTagName(t)[0];
    o.src = u;
    if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
    s.parentNode.insertBefore(o, s);
  }
</script>
<script>
  async("https://cdn.staticfile.org/fastclick/1.0.6/fastclick.min.js", function(){
    FastClick.attach(document.body);
  })
</script>

<script>
  var hasLine = 'true';
  async("https://cdn.staticfile.org/highlight.js/9.12.0/highlight.min.js", function(){
    $('figure pre').each(function(i, block) {
      var figure = $(this).parents('figure');
      if (hasLine === 'false') {
        figure.find('.gutter').hide();
      }
      hljs.configure({useBR: true});
      var lang = figure.attr('class').split(' ')[1] || 'code';
      var codeHtml = $(this).html();
      var codeTag = document.createElement('code');
      codeTag.className = lang;
      codeTag.innerHTML = codeHtml;
      $(this).attr('class', '').empty().html(codeTag);
      figure.attr('data-lang', lang.toUpperCase());
      hljs.highlightBlock(block);
    });
  })
</script>
<!-- Baidu Tongji -->



<script src='https://cdn.staticfile.org/mermaid/8.11.2/mermaid.min.js'></script>



<script src="/js/script.js"></script>


  </body>
</html>